package com.jida.tijian.controller;

import com.jida.tijian.dto.ResponseObject;
import com.jida.tijian.dto.CalendarRequestDto;
import com.jida.tijian.service.CalendarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
public class CalendarController {

    /*
    * 参数 年份 月份 医院编号 请求对象要有这三个
    *
    * 相应对象：前端请求日历后需要的数据结构
    * 一：对应年份和月份的日历
    * 二：挂号规则和余号信息
    * 挂号只能挂明天开始30天内的号
    *
     */
    @Autowired
    CalendarService calendarService;
    @RequestMapping("/listCalendar")
    public ResponseObject listCalendar(@RequestBody CalendarRequestDto calendarRequestDto){
        return new ResponseObject<>(ResponseObject.SUCCESS_STATUS,calendarService.listAppointmentCalendar(calendarRequestDto),ResponseObject.SUCCESS_DESC);
    }



    @RequestMapping("/listAppoinmentCalendar")
    public ResponseObject listAppoinmentCalendar(@RequestBody CalendarRequestDto calendarRequestDto, HttpServletRequest request){
        return new ResponseObject(ResponseObject.SUCCESS_STATUS,calendarService.listAppointmentCalendar(calendarRequestDto),ResponseObject.SUCCESS_DESC);
    }

    @RequestMapping("/listAppoinmentCalendar2")
    public ResponseObject list2(@RequestBody CalendarRequestDto calendarRequestDto) { // 你需要在这里加上参数
        return new ResponseObject(ResponseObject.SUCCESS_STATUS, calendarService.listAppointmentCalendar(calendarRequestDto), ResponseObject.SUCCESS_DESC);
    }
}
